/**
 * author: 何其沆(pooky)
 * desc: AdminOthers - api
 * date: 2021-11-30
 */
import { get, post } from '@/utils/request.js'
import api from '@/config/index.js'

export default {
  /**
   * 后台管理客户组织分页查询
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  organizationQuery(data) {
    return post(api.API_VERSION + '/Admin/Others/Organization/QueryPages', data, false)
  },
  /**
   * 后台管理客户组织添加
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  organizationCreate(data) {
    return get(api.API_VERSION + '/Admin/Others/Organization/CreateOrg', data, false)
  },
  /**
   * 后台管理客户组织删除
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  organizationDelete(data) {
    return get(api.API_VERSION + '/Admin/Others/Organization/DeleteOrg', data, false)
  },
  /**
   * 后台管理客户组织更新
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  organizationUpdate(data) {
    return post(api.API_VERSION + '/Admin/Others/Organization/UpdateOrg', data, false)
  },
  /**
   * 后台管理客户操作记录分页查询
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  recordQuery(data) {
    return post(api.API_VERSION + '/Admin/Others/OperateRecord/QueryPages', data, false)
  },
  /**
   * 获取组织
   * @param data
   */
  getOrganizationByClientId(data) {
    return get(api.API_VERSION + '/Admin/Others/Organization/GetDictOrganizationByClientID', data, false)
  },
  /**
   * 修改组织
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  updateOrganizationById(data) {
    return post(api.API_VERSION + '/Admin/Others/Organization/UpdateOrganizationByClientID', data, false)
  },
  /**
   * 添加组织
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  createOrganization(data) {
    return post(api.API_VERSION + '/Admin/Others/Organization/CreateOrganizationByClientID', data, false)
  },
  /**
   * 通过客户信息查找列表
   * @param data
   * @returns {Promise | Promise<unknown>}
   */
  getClientPage(data) {
    return post(api.API_VERSION + '/Admin/Others/Organization/ClientQueryPages', data, false)
  }
}
